//
// Created by wangwanlong on 2024/11/4.
//

#ifndef MKAHYPAR_I_REFINER_H
#define MKAHYPAR_I_REFINER_H
#include "mkahypar/partition/metrics.h"
namespace mkahypar {
  class IRefiner {
  public:
    IRefiner() = default;
    IRefiner(const IRefiner &) = delete;

    IRefiner(IRefiner &&) = delete;

    IRefiner &operator=(const IRefiner &) = delete;

    IRefiner &operator=(IRefiner &&) = delete;

    bool refine(std::vector<HypernodeID> &refinement_nodes,
                Metrics &best_metrics) {
      return refineImpl(refinement_nodes,
                        best_metrics);
    }

    //搜索前初始化
    void initialize() {
      initializeImpl();
    }


    //计算初始目标函数
    void computeObj(Metrics &obj){
      computeObjImpl(obj);
    }

  private:
    virtual bool refineImpl(std::vector<HypernodeID> &refinement_nodes,
                            Metrics &best_metrics) = 0;

    virtual void initializeImpl( ) {  };

    void virtual computeObjImpl(Metrics &obj){

    }

  };
}
#endif //MKAHYPAR_I_REFINER_H
